#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : vector_store_model.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/10 10:04
from tortoise import fields

from apps.models.base_model import BaseModel
from apps.utils.enumerate import VectorStoreEnum


class VectorStore(BaseModel):
    __doc__ = "向量存储库配置表"
    vector_store_name = fields.CharField(max_length=256, null=False, description='向量存储库名称')
    vector_store_type = fields.IntEnumField(VectorStoreEnum, default=VectorStoreEnum.milvus, description='向量存储库类型')
    vector_store_address = fields.CharField(max_length=256, null=False, description='向量存储库地址')
    vector_store_port = fields.CharField(max_length=256, null=False, description='向量存储库端口')
    vector_store_user = fields.CharField(max_length=256, null=True, description='向量存储库用户名')
    vector_store_password = fields.CharField(max_length=256, null=True, description='向量存储库密码')
    vector_store_database = fields.CharField(max_length=256, null=False, description='向量存储库数据库')
    vector_store_index = fields.JSONField(default=None, null=True, description='向量存储库索引')
    description = fields.CharField(max_length=256, null=True, description='描述')
    is_default = fields.BooleanField(default=False, description='是否默认')

    class Meta:
        table = "vector_store"
        table_description = "文生图模型配置表"
